package com.ld.control;

import com.ld.control.properties.LDProperties;
import com.ld.control.thread.BackgroundThread;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;

@Slf4j
@MapperScan(value = {"com.ld.control.business.*.mapper"})
@ServletComponentScan // 过滤器
@SpringBootApplication
public class LdCentralControlServerApplication implements CommandLineRunner {

	@Autowired
	private LDProperties ldProperties;

	@Autowired
	private BackgroundThread backgroundThread;

	public static void main(String[] args) {
		SpringApplication.run(LdCentralControlServerApplication.class, args);
	}

	@Override
	public void run(String... args) {
		log.info("===============================================");
		log.info("ldProperties:{}", ldProperties);
		log.info("===============================================");
		log.info("version:2025-10-13_01");
		log.info("LdCentralControlServerApplication Start Success");
		backgroundThread.init();
	}
}
